package cn.lyd.service.impl;

import cn.lyd.domain.Emp;
import cn.lyd.mapper.EmpMapper;
import cn.lyd.service.IEmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(readOnly = true,propagation = Propagation.SUPPORTS)
public class EmpServiceImpl implements IEmpService {

    @Autowired
    private EmpMapper empMapper;

    @Override
    public List<Emp> findAll() {
        return empMapper.findAll();
    }

    @Override
    public Emp loadById(Long eid) {
        return empMapper.loadById(eid);
    }

    @Override
    public void save(Emp emp) {
        empMapper.save(emp);
    }

    @Override
    public void update(Emp emp) {
        empMapper.update(emp);
    }

    @Override
    public void delete(Long eid) {
        empMapper.delete(eid);
    }
}
